<?php
namespace app\common\validate;

use think\Validate;

class Product extends Validate
{
    protected $rule = [
        'name'  =>  'require',
        'unit' =>  'require',
        'category_id' =>  'gt:0',
        'brand_id' =>  'gt:0',
        'ml' =>  'gt:0',
        'degree' =>  'gt:0',
        'date_in_produced'  =>  'require',
        'place_of_origin'  =>  'require',
    ];

    protected $message = [
        'name.require' => '产品名不能为空',
        'unit.require' => '单位不能为空',
        'category_id.gt' => '请选择分类',
        'brand_id.gt' => '请选择品牌',
        'ml.gt' => '请输入产品容量',
        'degree.gt' => '请输入产品度数',
        'date_in_produced.require' => '请选择生产日期',
        'place_of_origin.require' => '请输入产品产地',
    ];

}